
import { RouteObject } from 'react-router-dom';
import Layout from '../app/Layout';
import RequestDemo from '../demo/RequestDemo';
import Home from '../views/Home';
import User from '@/views/user/User';
import ApiList from '@/views/api/ApiList';
import DataList from '@/views/data/DataList';
import TableList from '@/views/table/TableList';
import Login from '@/views/login/Login';
import ArchiveList from '@/views/archive/Archive';
import ProductList from '@/views/product/Product';
import ApiCategory from '@/views/api/ApiCategory';
import ApiAggregate from '@/views/dashboard/ApiAggregate';
import Workplace from '@/views/dashboard/Workplace';
import Analysis from '@/views/dashboard/Analysis';
import DataManagement from '@/views/data/DataManagement';

const routes: RouteObject[] = [
    {
        path: "/", element: <Layout />,
        children: [
            {
                path: "/home", element: <Home />,
                children: [
                    {
                        path: "",
                        element: <ApiAggregate />,

                    },
                    {
                        path: "workplace", element: <Workplace />
                    },
                    {
                        path: "analysis", element: <Analysis />
                    },
                    // 接口
                    {
                        path: "api/index", element: <ApiList />
                    },
                    {
                        path: "api/category", element: <ApiCategory />
                    },
                    // 数据
                    {
                        path: "data/index", element: <DataList />
                    },
                    {
                        path: "data/management", element: <DataManagement />
                    },
                    // 表
                    {
                        path: "table/index", element: <TableList />
                    },
                    // 归档
                    {
                        path: "archive/index", element: <ArchiveList />
                    }
                ]
            },
            // 用户管理
            {
                path: "/user", element: <User />
            },
            // 产品管理
            { path: "/", element: <ProductList /> },
            // 登录
            { path: "/login", element: <Login /> },
            { path: "/demo", element: <RequestDemo /> },
        ]
    },
];

export default routes;